/**
 * 
 */
package messaage;

import com.thoughtworks.xstream.XStream;
import com.thoughtworks.xstream.io.xml.DomDriver;
import forum.Thread;

/**
 * @author Olga
 * 
 */
public class GotThreadMsg extends Message {

	protected String forumID;
	protected forum.Thread thread;


	public GotThreadMsg(String forumID, Thread thread) {
		super();
		this.forumID = forumID;
		this.thread = thread;
		this.type = "GotThreadMsg";
	}
	/*
	 * (non-Javadoc)
	 * 
	 * @see messaage.Message#toString()
	 */
	@Override
	public String toString() {
		XStream xstream = new XStream(new DomDriver());
		String xml = xstream.toXML(this)+"\0";
		
		return xml;
	}
		

	/**
	 * @param forumID the forumID to set
	 */
	public void setForumID(String forumID) {
		this.forumID = forumID;
	}

	/**
	 * @return the forumID
	 */
	public int getForumID() {
		return Integer.parseInt(forumID);
	}

	/**
	 * @return the thread
	 */
	public forum.Thread getThread() {
		return thread;
	}
	
	/**
	 * @param thread the thread to set
	 */
	public void setThread(forum.Thread thread) {
		this.thread = thread;
	}
	
	

}
